"""
__project__ = 'thc'
__file_name__ = '练习'
__author__ = 'thc'
__time__ = '2020/11/2/002 17:01'
__product_name = PyCharm
-*- coding:utf-8 -*-
"""


# for a in range(6):
#     for b in range(a):
#         print('*', end='')
#     print()
# if a == 5:
#     for a in range(5, 0):
#         for b in range(a):
#             print('*', end='')
#         print()
# a = 1
# while a <= 5:
#     b = 1
#     while b <= a:
#         print('*', end='')
#         b += 1
#     print()
#     a += 1
# a = 5
# while a >= 1:
#     b = 1
#     while b < a:
#         print('*', end='')
#         b += 1
#     print()
#     a -= 1

# a = 1
# while a <= 5:
#     b = 1
#     while b <= a:
#         print('*', end='')
#         b += 1
#     print()
#     a += 1
#     if a == 6:
#         while a >= 1:
#             b = 1
#             while b <= a:
#                 print('*', end='')
#                 b += 1
#         print()
#         a -= 1
#
# for a in range(6)[-1:-6:-1]:
#     print(a)
#
# my_str = '123456789'
# my_str1 = '  asdf  zxASDASD  '
# # a = my_str.find(2)               #find搜索
# # # a = my_str.
# # print(a)
# #
# # b = my_str.index(4)            #index搜索
# # # b = my_str.
# # print(b)
#
# c = my_str.split('5')               #分割
# print(c)
#
# d = my_str.replace('5', '666')     #替换
# print(d)
#
# for i in range(5):                  #填充 （rjust,ljust ,center)
#     e = my_str[i].rjust(3, '0')
#     print(e)
# #
# f = 'hahah'.join(my_str1)                 #把列表转换为字符串
# print(f)
# #
# # g = my_str. count('2')            #统计
# # print(g)
# #
# h = my_str1.strip()                #去空格！！！
# print(h)
# #
# i = h.capitalize()               #每个单词首字母大写
# print(i)
# #
# j = h.title()               #首字母大写
# print(j)
# #
# k = my_str.startswith('1')        #检查是否以什么为开头
# print(k)
# #
# l = my_str.endswith('2')          #检查是否以什么结尾
# print(l)
# #
# m = my_str1.upper()               #全部为大写
# print(m)
# #
# n = my_str1.lower()              #全部小写
# print(n)

# my_list = list('1357642')


# # 增
# my_list.append(7)
# my_list.extend('8')
# my_list.insert(0, 9)
# 改
# my_list[0] = 2
# 删
# # my_list.pop(0)
# my_list.remove('1')
# # my_list.clear()
# del my_list[2]

# 查
# i = my_list.index('2')
# i = my_list.count('2')

# 正序
# my_list.sort(reverse=False)
# 逆序
# my_list.sort(reverse=True)
# 倒序
# my_list.reverse()
#
# print(my_list)
#
#
# 元组
# my_tuple = (1)     打印出的是int类型
# my_tuple = (1,)    打印出的是元组（必须有,才是元组）
#
# my_tuple = tuple()        创建元组
#
# 元组的查只能用  if判断   index查询   count统计数
# my_tuple.index()
# my_tuple.count()
#
#
#
# 字典   dict    键值对，key是唯一，不可变的     无序，不可用下标
# my_dict = dict()
# my_dict = {}             创建字典
#
# 字典的查可以用if判断   判断的默认为key
# my_value = my_dict[key]       通过key查询value值
# len(my_dict)                  查看字典长度
#
# 字典有3中自带的类型  dict_keys    dict_values    dict_items
# my_dict.keys            查看字典内所有的key值属于dict_keys类型;可转换为列表
# my_dict.values          查看字典内所有的value值，属于dict_values类型;可转换为列表
# my_dict.items           查看字典内所有的键值对，属于dict_items类型;可转换为列表
#
#
# my_value = my_dict.setdefault(key)         通过key查询value值，如果没有这个key则把这个key跟value添加为键值对
#
# my_value = my_dict.get(key,['haha'])       通过key查询value值，如果没有则返回None，不会添加键值对
#                                            （haha可不写，如写则反haha）
#
# setdefault与get的区别： setdefault遇到没有的key会添加键值对，get不会添加；    现实中主要使用setdegault
#
# 字典：删除
# del my_dict.[key]                通过key来删除整个键值对
# my_dict.clear()                  清空整个字典
#
# 字典：增加与修改
# my_dict[key] = '123'             如果有这个key则把value值改为123，如果没有这个key则添加成一个键值对
#
#



# a = {1, 2, 3, {4: 5}}
# b = {3, 4, 5, 6}
# c = a.symmetric_difference(b)
# print(a)

#
# def my_fun():
#     """
#     这是文档说明
#     :return:
#     """
#
#
# help(my_fun)

#
# a = {1, 2, 3, 4, 4}
# b = {3, 4, 5, 6}
# c = b - a
# print(c)
#
#
# def dum(a):
#     a = 3
#     print(a)
#
#
# a = 1
# dum(a=1)
# print(a)
#
#
# def a():
#     return '-' * 100
#
# def b(c):
#     for i in range(c):
#         print(a())
#
#
#
# b(3)

#
# f = open('lebo.txt', mode='w', encoding='utf-8')
# f.write('1')
# f.write('456456')
# f.close()
#
# r = open('lebo.txt', mode='r', encoding='utf-8')
# ret = r.read()
# print(ret)
# r.close()


# try:
#     print(a)
# except Exception as a:
#     print('hh', a)

#
# a = 'rattle'
# for i in range(len(a)-2):
#     b = bool(a[i] == a[i+1])
# print(b)
#


# i = input('请输入成绩分数')
#
# if i >= '90':
#     print('A')
# elif i >= '60':
#     print('B')
# else:
#     print('C')

# while True:
#     username = input('请输入账号')
#     password = input('请输入密码')
#     if username == 'username' and password == 'passwd':
#         print('登录成功')
#         break
#     else:
#         print('账号密码错误')



# class Students(object):
#
#     def __init__(self, name, age, sex):
#         self.name = name
#         self.age = age
#         self.sex = sex
#
#     def xueXi(self):
#         print('学习')
#
#     def xiuXi(self):
#         print('休息')
#
#
# xiaoMing = Students('小明', '18', '男')
# xiaoMing.xueXi()
# xiaoMing.xiuXi()

li = ['alex', 'eric', 'rain']

a = '_'.join(li)
print(a)








